begintalkscript;
variables;

begintalknode 1;
state = -1;
nextstate = 1;
question = "Marcus";
condition = 1;
text1 = "There is a lone person in the hall sitting at a desk, writing. He has'nt got the uniform of an Empire Liaison or a governor.";
text2 = "Instead, he has white robes and an ankh hanging from his neck. He notices you and says:";
text3 = "_Hello, I have been expecting you for long. I am Marcus, the governor of Serpent Delta, proud member of the Nelphis cult and Empire Liaison of Alexandra._";
action = INTRO;
text5 = "_Hello. What is it you want?_";

begintalknode 2;
state = 1;
nextstate = 1;
condition = 1;
question = "Tell me about Alexandra.";
text1 = "_This city is the heart of the Serpent Delta, the known lands on the Island of Rovan. There's lots of traffic here. What was here today will be gone tomorrow._";
text2 = "_Merchants are running to and fro trading fish, metal and alchemy stuff. But their numbers have been decreasing lately._";
text3 = "_That reminds me! There is a bandit infestation to the north. The bandits are not a big problem, but there's something curious about them._";
text4 = "_As if they would have arrived here as bandits from far away._";

begintalknode 3;
state = 1;
nextstate = 2;
condition = 1;
question = "Tell me about the naga.";
text1 = "_We became allies with it. It was a wise decision. The Emperor wanted to toss it into the deep but we refused. Then we told about the naga's abilities._";
text2 = "_After learning about the abilities they commanded us to make sure the naga would not turn against us._";

begintalknode 4;
state = 2;
nextstate = 3;
condition = 1;
question = "What abilities did the naga have?";
text1 = "_The naga was the only one able to unlock the mighty Orb of Nar. Using the Orb, we made this area desirable. There was nephilim here before we arrived._";
text2 = "_But now they're gone. Or were. We fear that they have found their chance to strike back._";

begintalknode 5;
state = 3;
nextstate = 4;
condition = 1;
question = "Why do you fear that an almost extingt race would attack?";
text1 = "_They're not extingt. I know that. There is lots and lots of them in the Nepheline woods and beyond them. And I do think that Vrrrr has something to do with them._";
code = set_flag(110, 5, 1); break;

begintalknode 6;
state = 4;
nextstate = 4;
condition = 1;
question = "Who is this 'Vrrrr'";
text1 = "_He's a nephil. Or nephar. I don't know. He has a hut on one of the isles in the delta. He is aggressive, skilled with the bow, carnivoran etc._";

begintalknode 7;
state = 4;
nextstate = -1;
condition = 1;
question = "What do you think that this 'Vrrrr' has to do with the other nephilim.";
text1 = "_My spies in Azure Isle have told me that he uses to walk miles into the woods and come back alive. He has also been seen together with strange people and even sliths, they have told._";
text2 = "_Of that I don't know what is rumors and what is true._";
code = set_flag(110, 7, 1); break;

begintalknode 8;
state = 1;
nextstate = 1;
condition = get_flag(110, 7) == 1;
question = "Tell me about Azure Isle.";
text1 = "_Not much special to tell. Lots of soldiers. Many guards and bowmen. A nice inn. No smithy, though. Merchants sail back and forth between this city and the fort. They make good money._";
text2 = "_The Azure Isle fort will be essential if there would be a large attack._";

begintalknode 9;
state = 1;
nextstate = 5;
condition = 1;
question = "Tell me about my job here.";
text1 = "_Your job here is to bring the naga and the orb together. Only then will the Delta be safe. Otherwise, the nephilim hiding in the woods may someday attack here._";

begintalknode 10;
state = 5;
nextstate = -1;
condition = get_flag(110, 10) == 0;
question = "What shall I start with.";
text1 = "_You could start by going and talking to Arghadz and see if you get anywhere. He is a vahnatai who has somehow made his way to a hill to the east._";
text2 = "_I suspect that the vahnatai have something to do with this. Return to me and report if you obtain anything of interest._";
code = set_flag(110, 10, 1);
       toggle_quest(4, 1);
break;

begintalknode 11;
state = 1;
nextstate = 1;
condition = get_flag(2, 0) == 1;
question = "There is a tunnel below Arghadz home that leads into a huge cave.";
text1 = "_Now that was surprising! I did not expect that there would be a piece of vahnatai land right below our feet._";
text2 = "_Go there, and see if you can find the leader of the vahnatai._";
code = set_flag(2, 0, 2);
break;

begintalknode 12;
state = 1;
nextstate = 1;
condition = get_flag(104, 0) == 1;
question = "I met their leader. His name is Rendar. I found out that they have stolen the Orb.";
text1 = "You tell him about the castle, and about Rendar and what they wanted and didn't want to do with the orb. He doesn't seem very surprised.";
text2 = "_I knew it! I knew that it was them who stole it. But I didn't know that they did not want to harm us by stealing it. This gets complicated._";
text3 = "_Return there, and ask if you could get back the orb. If they refuse, tell them that you'll give it back to them after your quest._";
code = toggle_quest(4, 0);
       set_flag(104, 0, 2);
break;

begintalknode 13;
state = 1;
nextstate = 1;
condition = get_flag(104, 0) == 4;
question = "They accepted our offer and even said that they'd send their own warriors to help while you're without the orb.";
text1 = "_Now this gets really complex. Hmmmm...Maybe we COULD give the orb to them in the end. I wasn't really going to give it to them, but now it is not a bad idea._";
text2 = "_Anyway, now that you have the orb one part of your quest is done. Now you'll have to find the naga and thus unlock the orb and then seize the leader of these ravagers._";
text3 = "_Travel northeast and then south. You should come to the Nepheline Woods. Travel (or fight your way) south, and see if you can find any signs of the naga._";
code = toggle_quest(5, 1);
    award_party_xp(500, 25);
    set_flag(104, 0, 5);
break;

begintalknode 14;
state = 1;
nextstate = 1;
condition = get_flag(200, 1) == 1;
question = "I have found out something really interesting about the bandits.";
text1 = "You tell Marcus what you found out about the origin of the bandits. He looks surprised, almost shocked.";
text2 = "_So the Emperor was wrong. There WAS a non-magical link between Avernum and the surface world. So they help the nephilim. And there are sliths among them._";
text3 = "_Well, that really explains the rumors about those who sealed the naga. Now we have for the first time humans, nephilim and sliths allied against us._";
text4 = "_You shall be rewarded for this._";
code = change_coins(300);
       set_flag(200, 1, 2);
break;

begintalknode 15;
state = 1;
nextstate = 1;
condition = get_flag(15, 4) == 1;
question = "I found the naga and unlocked the orb, but the ravagers managed to flee and take the naga with them.";
text1 = "You tell him that they fled to Avernum via a tunnel at the further end of their realm. _Dang! Just as we were catching up with them._";
text2 = "_Well, I guess you'll have no choice but follow them to Avernum. Sadly, there is no guarantee that you will be able to return. This is a difficult situation._";
code = toggle_quest(5, 0);
       set_flag(15, 4, 1);
break;

begintalknode 16;
state = 1;
nextstate = 1;
condition = get_flag(15, 4) == 2;
question = "I know where the ravagers went!";
text1 = "You tell him that they came 'back' here and built a hidden outpost, waiting until the people in the Delta would forget about the situation and then try again.";
text2 = "_Ha Ha! Now we got them! Now that we have vahnatai allies and the orb unlocked we can finally get them. I'll send out a legion of local empire soldiers._";
text3 = "_Your mission is to go into the outpost with the Orb and make them flee from there. Then, my legion will seize them. Good Luck!_";
action = END_TALK;
code =
       set_flag(15, 4, 3);
       set_town_visibility(8, 1);
break;

begintalknode 17;
state = 1;
nextstate = 1;
condition = get_flag(8, 8) == 1;
question = "I have done what you told. The bandits should now be defeaten.";
text1 = "_Thank you! The soldiers arrived here recently, with the rogue leaders seized. You are now free to leave the delta._";
text2 = "_I shall give you a great reward for this!_ He hands you a gold pouch and a white sword.";
code = set_flag(8, 8, 2);
       change_coins(7000);
       reward_give(442);
break;




begintalknode 20;
state = -1;
nextstate = 10;
question = "Faradoc";
condition = 1;
text1 = "A wizard is sitting here among all the mess writing rune magic. You bet he's responsible for it.";
text2 = "_Hello, sorry about this mess. I am Faradoc, the wizard. I suppose you want to learn about magic?_";

begintalknode 21;
state = 10;
nextstate = 10;
question = "Why is this place so messy?";
condition = 1;
text1 = "_I prefer not to tell you._";

begintalknode 22;
state = 10;
nextstate = 10;
condition = 1;
question = "Can you teach me magic?";
text1 = "You finish training.";
code = 
    if (get_flag(110, 23) != 2) begin_shop_mode("Magical training.", "Faradoc is willing to let you study his spellbooks and notes against a fee.", 6, 4, -1);
    if (get_flag(110, 23) == 2) begin_shop_mode("Magical training.", "Faradoc is willing to let you study his spellbooks and notes against a small fee.", 6, 0, -1);
break;

begintalknode 23;
state = 10;
nextstate = -1;
condition = get_flag(110, 23) == 0;
question = "You seem very busy with all lab equipment here. Is there anyrhing small I can help you with?";
text1 = "_No, there is nothing SMALL you could do, there is only one bigger thing you can help me with._";
text2 = "_If you're bored, you could go east to the cragland of Arachi and see if you find a band of giants. They stole a talisman from me. It should be shaped like a spoon._";
text3 = "_Bring it to me, and I'll honestly get you a bargain with the spells._";
code = toggle_quest(6, 1);
       set_flag(110, 23, 1);
break;

begintalknode 24;
state = 10;
nextstate = 11;
condition = has_special_item(3);
question = "Here is your talisman.";
text1 = "_Thank you! I will teach you magic for cheaper now._";
code = toggle_quest(6, 0);
    change_spec_item(3, -1);
    set_flag(110, 23, 2);
break;

begintalknode 25;
state = 11;
nextstate = -1;
condition = 1;
question = "By the way, what do you use that talisman to?";
text1 = "_Eating, of course. Why would anyone create a spoon which can't be used to eat with?!_";






begintalknode 30;
state = -1;
nextstate = 15;
question = "Bandhalf";
condition = 1;
text1 = "This wizard is quite tall. He is old, and his face has many wrinkles. His beard is white.";
text2 = "_Greetings! You can call me Bandhalf. Ahem! No questions from you! You have come here to learn magery, haven't you?_";

begintalknode 31;
state = 15;
nextstate = 16;
condition = 1;
question = "Yes, how did you know?";
text1 = "_I said no questions! If you want to ask me something, you'll have to pay for it. It's ten gold per question. I am capable of foreseeing._";

begintalknode 32;
state = 15;
nextstate = 15;
condition = 1;
question = "Yes, can I get some?";
text1 = "_How many times do I have toI mean, yes. Talk to Zery. He'll help you with that._";

begintalknode 33;
state = 16;
nextstate = -1;
condition = 1;
question = "Humph! Fine!What are your abilities. (pay 10 coins)";
text1 = "_That's one question and tenNo take your money back! That question wasn't worth anything. My ability is foreseeing. Thus, I can identify your items._";
text2 = "_It's ten coins per object._";
action = ID 10;






begintalknode 34;
state = -1;
nextstate = 17;
question = "Zery";
condition = 1;
text1 = "There is a short wizard sitting here. He has got a walking stick.";
text2 = "_Hello, hello, young friends! What brings you to our school of magery?_";

begintalknode 35;
state = 17;
nextstate = 17;
condition = 1;
question = "Can I get training from you?";
text1 = "You finish training.";
code = begin_shop_mode("Magery", "Zery will teach you magic for reasonable prices.", 17, 3, -1);
break;

begintalknode 36;
state = 17;
nextstate = 18;
condition = 1;
question = "Tell me about this school.";
text1 = "_There is not much left of this school anymore. There used to be other buildings. But the Empire doesn't want magic to be taught to every child._";
text2 = "_There are fewer and fewer apprentices every year. And I fear that some day they willremove this school._ Looks like he's afraid of something.";

begintalknode 37;
state = 18;
nextstate = 19;
condition = 1;
question = "What is it that you fear about closing the school?";
text1 = "_Have you been to Skylark Vale? Yes? Well, you propably know that there used to be a school of magery too. It was closed by the Empire._";
text2 = "_But that wasn't the worst thing they did._";

begintalknode 38;
state = 19;
nextstate = -1;
condition = 1;
question = "What was the worst thing they did?";
text1 = "_TheyTheyThey killed all magi!_ A long pause _Those fools. They think that magic is some kind of martial art which must be forbidden._";
text2 = "_The truth is that we have always taught our apprentices that magic must never be used to gain power. When will they realize?!_";